const envGoal =
  process.argv[
    process.argv.findIndex((val) => {
      return val === '--goal';
    }) + 1
  ];

module.exports = {
  dotenv: (chain) => {
    const Dotenv = require('dotenv-webpack');

    chain.plugin('dotenv').use(
      new Dotenv({
        path: `.env.${envGoal}`,
      }),
    );
  },
};
